package com.dsbj.mp.icardservice.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsbj.mp.icardservice.entity.MpRole;
import com.dsbj.mp.icardservice.mapper.MpRoleMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * "角色"的服务类。
 */
@Service
@Transactional
public class MpRoleService extends ServiceImpl<MpRoleMapper, MpRole> {
	
	@Resource
	private MpRoleMapper mpRoleMapper;
	
	
	/**
	 * 根据角色名称获取该角色。
	 * @param
	 * @return
	 * @author cjw 2020-03-02
	 */
	public MpRole getMpRoleByName(String name){
		QueryWrapper<MpRole> queryWrapper=new QueryWrapper<MpRole>()
				.eq("NAME",name);
		MpRole mpRole=mpRoleMapper.selectOne(queryWrapper);
		return mpRole;
	}
	
	
	

}
